package cn.s1995.sloth.bizs.entity;

import cn.s1995.sloth.bizs.annotation.SysDictType;
import cn.s1995.sloth.bizs.constant.DictNames;
import cn.s1995.sloth.bizs.converter.SysDictConverter;
import cn.s1995.sloth.bizs.entity.base.BaseEntity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 产品分组
 *
 * @author Sashi
 * @date 2023-12-20 09:49:45
 */
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "产品分组")
@TableName("biz_prod_group")
@ExcelIgnoreUnannotated
public class ProdGroup extends BaseEntity {


	/**
	* ID
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID")
    private Long id;

	/**
	* 分组名称
	*/
    @ExcelProperty(value = "分组名称", index = 0)
    @Schema(description = "分组名称")
	@TableField("`name`")
    private String name;

	/**
	* 店铺id
	*/
    @Schema(description = "店铺id")
    private Long shopId;

	/**
	* 状态: 1.启用 0.禁用
	*/
    @SysDictType(DictNames.biz_com_state_enable)
    @ExcelProperty(value = "状态", index = 1, converter = SysDictConverter.class)
    @Schema(description = "状态: 1.启用 0.禁用")
    private Integer state;

	/**
	* 默认类型(0.系统默认 1.商家自定义)
	*/
    @Schema(description = "默认类型(0.系统默认 1.商家自定义)")
    private Boolean isDefault;

	/**
	* 产品数量
	*/
    @ExcelProperty(value = "产品数量", index = 2)
    @Schema(description = "产品数量")
    private Integer prodCount;

	/**
	* 列表样式(1.一列一个 2.一列两个 3.一列三个)
	*/
    @SysDictType(DictNames.biz_prod_group_style)
    @ExcelProperty(value = "列表样式", index = 3, converter = SysDictConverter.class)
    @Schema(description = "列表样式(1.一列一个 2.一列两个 3.一列三个)")
    private Integer style;

	/**
	* 排序
	*/
    @ExcelProperty(value = "排序", index = 4)
    @Schema(description = "排序")
    private Integer sort;

    /**
     * 关联的产品
     */
    @TableField(exist = false)
    private List<ProdGroupReference> prodGroupReferenceList;
}
